﻿using DevExpress.XtraEditors;
using System.Windows.Forms;

namespace CsGo.User
{
    public partial class LoginView : XtraForm
    {
        public bool bLogin = false; //判断用户是否登录
        public LoginView()
        {
            InitializeComponent();
            #region 解决闪烁问题
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
            #endregion
        }
        #region 解决闪烁问题
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0x0014) // 禁掉清除背景消息
                return;
            base.WndProc(ref m);
        }
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x02000000;
                return cp;
            }
        }
        #endregion
       
        private void sb_Login_Click(object sender, System.EventArgs e)
        {
            bLogin = true;
            this.DialogResult = DialogResult.OK;
        }

        private void sb_Exit_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }
    }
}
